package com.webservice.demo.service.impl;

import com.webservice.demo.entity.User;
import com.webservice.demo.service.DemoService;

import javax.jws.WebService;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/**
 * description
 *
 * @author luheng
 * create  2019-01-16
 */

@WebService(serviceName = "DemoService", // 与接口中指定的name一致
        targetNamespace = "http://service.demo.webservice.com", // 与接口中的命名空间一致,一般是接口的包名倒
        endpointInterface = "com.webservice.demo.service.DemoService"// 接口地址
)
public class DemoServiceImpl implements DemoService {

    private Map<String, User> userMap = new HashMap<String, User>();
    public DemoServiceImpl() {
        System.out.println("向实体类插入数据");
        User user = new User();
        user.setUserId("1");
        user.setUserName("test1");
        user.setEmail("maplefix@163.xom");
        userMap.put(user.getUserId(), user);

        user = new User();
        user.setUserId("2");
        user.setUserName("test2");
        user.setEmail("maplefix@163.xom");
        userMap.put(user.getUserId(), user);

        user = new User();
        user.setUserId("3");
        user.setUserName("test3");
        user.setEmail("maplefix@163.xom");
        userMap.put(user.getUserId(), user);
    }
    @Override
    public User getUser(String id) {
        System.out.print("userMap是:" + userMap);
        return userMap.get(id);
    }

}
